import request from '@/utils/request';
import { getParamsSuffix } from '@/utils/paramsUtils';

export async function listAllByPage(query) {
  const params = getParamsSuffix(query);
  return request(`/api/swservice/v1/sw/productionwaste/listAllByPage?${params}`, {
    method: 'GET',
  });
}

export async function queryAllDicts(query) {
  const params = getParamsSuffix(query);
  return request(`/api/swservice/v1/sw/productionwaste/queryAllDicts?${params}`, {
    method: 'GET',
  });
}

export async function create(params) {
  return request('/api/swservice/v1/sw/productionwaste/create', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}

export async function update(params) {
  return request('/api/swservice/v1/sw/productionwaste/update', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}

export async function deleteById(params) {
  return request('/api/swservice/v1/sw/productionwaste/delete', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}
